import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/sys_user/page',
    method: 'get',
    params: query
  })
}

export function createAccount(data) {
  return request({
    url: '/sys_user',
    method: 'post',
    data
  })
}

export function updateAccount(data) {
  return request({
    url: `/sys_user/${data.id}`,
    method: 'put',
    data
  })
}

export function deleteAccount(id) {
  return request({
    url: `/sys_user/${id}`,
    method: 'delete'
  })
}

export function changeAccountStatus(id, status) {
  return request({
    url: '/account/status',
    method: 'post',
    data: { id, status }
  })
}
